﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Himall.Entity.Config
{
   public class SKUInfoConfig : EntityTypeConfiguration<SKUInfo>
    {
        public SKUInfoConfig()
        {
            ToTable("Himall_SKUs");
            Property(item => item.Version).HasColumnType("varchar").HasMaxLength(100);
            Property(item => item.Size).HasColumnType("varchar").HasMaxLength(100);
            Property(item => item.Color).HasColumnType("varchar").HasMaxLength(100);
            Property(item => item.Id).HasColumnType("varchar").HasMaxLength(100);
            Property(item => item.Sku).HasColumnType("varchar").HasMaxLength(200);
            Property(item => item.ShowPic).HasColumnType("varchar").HasMaxLength(1000);
            HasRequired(x => x.ProductInfo).WithMany(x => x.SKUInfo).HasForeignKey(x => x.ProductId);
        }
    }
}
